package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {



    /*
    * 根据菜品ID查询对应的套餐ID
    * */
    List<Long> getSetMealIdsByDishIds(List<Long> dishIds);


    /*
    *批量保存套餐和菜品的关联关系
    * */
    void insertBatch(List<SetmealDish> setmealDishes);

    /*
    * 根据id集合 删除与套餐关联的菜品信息
    * */
    void deleteByDishIds(List<Long> ids);


    /*
    * 根据套餐ID查询关联的菜品信息
    * */

    @Select("select * from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);


    /*
    * 根据套餐ID 删除关联的菜品信息
    * */
    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deleteById(Long setmealId);


    /*
    * 根据菜品ID 获取套餐ID
    * */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);
}
